const path = require('path');
const htmlWwbpackPlugin = require('html-webpack-plugin');
//vue-loader新增
const VueLoaderPlugin = require('vue-loader/lib/plugin');
module.exports = {
    mode:'development',
    entry:path.join(__dirname,'./src/main.js'),
    output:{
        path:path.join(__dirname,'./dist'),
        filename:'bundle.js'
    },
    plugins:[
        new htmlWwbpackPlugin({
            template:path.join(__dirname,'./src/index.html'),
            filename:'index.html'
        }),
        new VueLoaderPlugin()
    ],
    module:{
        rules:[
            {test:/\.css$/,use:['style-loader','css-loader']},
            {test:/\.scss$/,use:['style-loader','css-loader','sass-loader']},
            {test:/\.js$/,use:'babel-loader',exclude:/node_modules/},
            {test:/\.vue$/,use:'vue-loader'},
            // { test: /\.(ttf|eot|svg|woff|woff2)$/, use: 'url-loader' }
            // {test:/\.(jpg|png)$/,use:'ulr-loader?limit=56&name=[name].[ext]'}
            // { test: /\.(jpg|png|gif|bmp|jpeg)$/, use: 'url-loader?limit=7631&name=[hash:8]-[name].[ext]' }, 
        ]
    },
    resolve:{
        alias:{
            "vue$": "vue/dist/vue.js"
        }
    }
}